<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="theme-color" content="#2196f3">
    <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap:">
    <title>登录v2</title>
    <#assign base=request.contextPath  />
    <link rel="stylesheet" href="${base}/framework7/css/framework7.bundle.min.css">
    <link rel="stylesheet" href="${base}/css/app.css">
</head>
<body>
    <div id="app">
        <div class="page no-toolbar no-navbar no-swipeback">
            <div class="page-content login-screen-content">
                <div class="login-screen-title">欢迎登录</div>
                <form>
                    <div class="list">
                        <ul>
                            <li class="item-content item-input item-input-with-value">
                                <div class="item-inner">
                                    <div class="item-title item-label">用户名</div>
                                    <div class="item-input-wrap">
                                        <input type="text" placeholder="您的手机号" id="demo-username-2" class="input-with-value">
                                        <span class="input-clear-button"></span>
                                    </div>
                                </div>
                            </li>
                            <li class="item-content item-input">
                                <div class="item-inner">
                                    <div class="item-title item-label">密码</div>
                                    <div class="item-input-wrap">
                                        <input type="password" placeholder="您的密码" id="demo-password-2" class="">
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="list">
                        <ul>
                            <li><a href="#" class="list-button" onclick="signIn();">登录</a></li>
                        </ul>
                        <div class="block-footer">Some text about login information.<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
                    </div>
                </form>
            </div>
        </div>

    </div>
    <#--<script src="${base}/js/jquery-3.2.0.js"></script>-->
    <script type="text/javascript" src="${base}/framework7/js/framework7.bundle.min.js"></script>
    <script type="text/javascript" src="${base}/js/app.js"></script>
    <script>

        function signIn() {
            var username = $('input#demo-username-2').val();
            var password = $('input#demo-password-2').val();


            app.request.post('login', { username: username, userpwd: password }, function (msg) {
                if (msg == 'success') {
                    window.location.href="index";
                }else {
                    app.dialog.alert('用户名或密码错误','提示');
                }
            });
        }

    </script>
</body>
</html>